
import {
  BrowserRouter as Router,
  Route,
  Switch,
  Redirect
}from "react-router-dom"

import routes, { RouteType } from "./config/routes";
export default function App() {
  return (
    <Router>
      <Switch>
        {routes.map((route:RouteType,index:number)=>{
          // return <Route path={route.path} component={route.component} />;
          // exact属性：让路由路径全匹配
          return <Route {...route} key={index} exact />;
        })}
         {/* 为了测试 */}
         <Redirect to="/phoneLogin" />
      </Switch>
    </Router>
  );
}
